using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace masterCard
{
    class BridgePlayer
    {
        public const int nHnadSize = 13;
        private Position m_ePos;
        private Card[] m_cHand;
        private ArrayList m_cBid;
        private int m_nHnadCardIndex;
        public BridgePlayer(Position pos)
        {
            m_cHand = new Card[nHnadSize];
            m_ePos = pos;
            m_cBid = new ArrayList();
        }
        public BridgePlayer()
        {
            m_cHand = new Card[nHnadSize];
        }
        public void AddCardToHand(Card aCard)
        {
            m_cHand[m_nHnadCardIndex++ % 13] = aCard;
        }
        public void ArrangeCard()
        {
        }
        public Card[] GetHand()
        {
            return m_cHand;
        }
        public Position Position
        {
            set { m_ePos = value; }
            get { return m_ePos; }

        }
        public Bid TopBid
        {
            get
            {
                if (m_cBid.Count > 1)
                {
                    return (Bid)m_cBid[m_cBid.Count - 1];
                }
                return null;
            }            
        }


        internal void InsertBid(Bid curBid)
        {            
            m_cBid.Add((Bid)curBid);                       
        }

        internal ArrayList GetBidList()
        {
            return m_cBid;
        }
    }
}
